


<div id="cont" class="container">
  <%include Homeleft.ejs%>
  <div id="homecenter" class="col-md-7 col-lg-7">
    <% if(user){ %>
    <form action="/report" method="post">
      <h4>有什么新鲜事想告诉大家？</h4>
      <textarea name="textarea" id="" cols="" rows="5"></textarea>
      <input class="submit" disabled="disabled" type="submit" value="发布">
      <div style="clear: both"></div>
    </form>
    <% }%>
    <% posts.forEach(function (post,index) {%>
    <section class="every">
      <div class="img"><img src="/images/touxiang.png" alt=""></div>
      <div class="tripe">
        <h4><%= post.name %></h4>
        <span>
          <% if( time.day == post.time.day ){ %>
          今天 <time><%= post.time.minute%></time> 来自微博weibo.com
          <%}else{%>
          <time><%= post.time.year%></time> 来自微博weibo.com
          <%}%>
        </span>
        <p><%- post.post%></p>
        <div class="good">
          <a href="/comment">评论</a>|
          <a href="#"><span class="glyphicon glyphicon-thumbs-up"></span>赞</a>
        </div>
      </div>
    </section>
    <%})%>
    <p>没有更多内容了</p>
  </div>
  <%include Homeright.ejs%>
</div>
<script>
  $(function () {
    $('#homecenter form textarea').keyup(function () {
      textarea();
    })
    function textarea() {
      if(!$('#homecenter form textarea').val()){
        $('#homecenter form .submit').css('opacity','0.7').attr('disabled','disabled');
      }else{
        $('#homecenter form .submit').css('opacity','1').removeAttr('disabled');
      }
    }
  })
</script>
